export class LocalStorage {
  static get<T>(key: string): T | null {
    try {
      return JSON.parse(localStorage.getItem(key) || 'null') as T;
    } catch (error) {
      console.error(`LocalStorage get error for ${key}:`, error);
      return null;
    }
  }

  static set<T>(key: string, value: T): void {
    try {
      localStorage.setItem(key, JSON.stringify(value));
    } catch (error) {
      console.error(`LocalStorage set error for ${key}:`, error);
    }
  }

  static remove(key: string): void {
    localStorage.removeItem(key);
  }
}
